#ifndef MAZEPATHFINDINGCA_H
#define MAZEPATHFINDINGCA_H

/*
#include <vector>
#include <cstdio>
#include "ca.h"
#include "rules/MazePathFinding.h"
#include "neighbourhoods/von_neuman_1.h"
#include "grid2d.h"

using namespace std;

class MazePathFindingCA:public CA
{

protected:
    //ilu sasiadow dla kazdego stanu
    vector<int> counts(vector<int> neighbours)
    {
        vector<int> state_counts(STATE_SIZE);
        for(unsigned int i=0;i<neighbours.size();++i)
        {
            if(neighbours[i]==-1)continue;
            ++state_counts[neighbours[i]];
        }
        return state_counts;
    }

public:

    MazePathFindingCA():CA()
    {
    }

    ~MazePathFindingCA()
    {
        delete current_states;
        delete new_states;
    }

    bool next()
    {

        bool changed=false;
        for(int i=0;i<current_states->size(1);++i)
            for(int j=0;j<current_states->size(0);++j){
                new_states->set(current_states->get(i,j),i,j);
                vector<int> state_counts=counts(neighbours(current_states,i,j));
                for(int r=0;r<RULES_SIZE;++r)
                {
                    bool f=true;
                    if(current_states->get(i,j)!=rules[r][0])continue;
                    for(int s=0;s<STATE_SIZE;++s)
                    {
                        if(state_counts[s]!=rules[r][s+1])
                        {
                            f=false;
                            break;
                        }
                    }
                    if(f)
                    {
                        int new_state=rules[r][STATE_SIZE+1];
                        changed=(new_states->get(i,j)!=new_state);
                        if(changed)new_states->set(new_state,i,j);
                        break;
                    }

                }
            }

        Grid* tmp=new_states;
        new_states=current_states;
        current_states=tmp;
        ++step;
        return changed;

    }

    void start(){
        while(next());
    }

    void start(int steps)
    {
        for(int i=0;i<steps;++i)next();
    }

    int getStep()const
    {
        return step;
    }


    Grid* grid_copy()const
    {
        return current_states->copy();
    }

    void set(const Grid& grid)
    {
        this->step=0;
        this->current_states = new Grid2D(dynamic_cast<const Grid2D&>(grid));
        this->new_states = new Grid2D(dynamic_cast<const Grid2D&>(grid));
    }

};
*/
#endif // MAZEPATHFINDINGCA_H
